import java.io.*;

public class Test {
    public static void main(String[] args) throws IOException {
        File file1 = new File("src\\a.txt");
        File file2 = new File("src\\b.txt");
        FileInputStream fis = new FileInputStream(file1);
        FileOutputStream  fos = new FileOutputStream(file2);
        byte[] bytes = new byte[1024];
        int len;
        while((len = fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }
        fos.close();
        fis.close();
    }
}
